﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using EventManager.Model.Factory;
using EventManager.Repositories;
using EventManager.Repositories.Concrete;

namespace EventManager.Resolver
{
    public class RepositoryModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            builder.RegisterType<DbFactory>().As<IDbFactory>().InstancePerLifetimeScope();
            builder.RegisterType<UnitOfWork>().As<IUnitOfWork>().InstancePerLifetimeScope();
            builder.RegisterType<EventsRepository>().As<IEventsRepository>();
            builder.RegisterType<CategoriesRepository>().As<ICategoriesRepository>();
        }
    }
}
